<template>
<div id="app">
  <h2>热门精选</h2>
  <div class="house-list">
    <template v-for="(value) in houseList" :key="value.cityId">
    <homeItemnine 
    v-if="value.discoveryContentType === 9" 
    :data="value.data"
    @click="itemClick(value.data)"
    />
    <homeItemthree 
    v-else-if="value.discoveryContentType === 3" 
    :data="value.data"
    @click="itemClick(value.data)"
    />
  </template>
  </div>
</div>
</template>

<script setup>
  import homeItemnine from '@/components/house-item-v9/index.vue'
  import homeItemthree from '@/components/house-item-v3/index.vue'
import { useRoute, useRouter } from 'vue-router'
  const router = useRouter();
const itemClick = (item)=>{
  router.push('/detail/'+item.houseId)
}

defineProps({
  houseList:{
    type:Array,
    default:()=>([])
  }
})
</script>
 
<style lang="less" scoped>
#app{
  margin: 0 20px;
  .house-list{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  h2{
    margin: 20px 0;
  }
}
</style>